Performance profiling is often used to investigate a computer program's behavior as the program runs. Through profiling, it can be determined which sections of a program can be improved for speed or memory usage, among other features. Many systems perform such profiling by inserting profiling instruments in source code, interpreted code, compiled code, machine code, or the like. For example, many profiling instrument include one or more routines that can perform tasks whenever the code containing the instrument is executed.
Interpreted code is one example of code that can be instrumented for profiling and for other uses. The interpreted code is translated into machine code at the time of execution, rather than being compiled directly into machine code. Managed code is one form of interpreted code that can execute under the management of a virtual machine. Examples of managed code can include Java bytecode operating under the Java Virtual Machine (JVM) and Intermediate Language code generated by the .NET Framework for C#, Visual Basic .NET, and Visual C++.